class TradeViewModel:
    def __init__(self, data):
        self.count = 0
        self.trades = []
        self.__parse(data)

    def __parse(self, data):
        self.count = len(data)
        self.trades = [self.__map_to_trade(x) for x in data]

    @classmethod
    def __map_to_trade(cls, data):
        return dict(
            create_time=data.create_time.strftime('%Y/%m/%d'),
            nickname=data.user.nickname,
            id=data.id
        )
